<?php	
	require_once dirname(BASEPATH) . '/application/models/local/data/_init_model.php';
	
	class mod_banner_position extends _init_model{
		public $BAN_P_ID;
		public $BAN_P_TITLE;
		
		function mod_banner_position(){
			parent::__construct();
		
			$this->tableName = 'banner_position';				
		}
		
		function get_banner_position_list(){
			$this->db->where('BAN_P_ID !=', 0);
			$query = $this->db->get($this->tableName);
			return $query->result_array();
		}
		function get_banner_position_for_dropdown(){
			$result = $this->get_banner_position_list();
			
			$return = array();
			if (count($result) > 0){
				for ($i=0; $i<count($result); $i++)
					$return[$result[$i]['BAN_P_ID']] = $result[$i]['BAN_P_TITLE'];
			}
			
			return $return;
		}
		function get_single_banner_position($id){
			$this->db->where('BAN_P_ID', $id);
			$query = $this->db->get($this->tableName);
			
			if ($query->num_rows() > 0)
				return $query->row_array(0);
			else
				return null;
		}
	}
?>